<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>RegExp match</title>
</head>
<body>
<h3>RegExp match 方法</h3>
<script>
    var str = "hello WoRld";
    var reg = /world/i;
    var reg1 = /worldd/i;
    var a = str.match(reg);
    console.log(a,typeof a) // 'WoRld' 返回匹配到的字符
    console.log(str.match(/ww/i))

    var str2 = "hello good node";
    var reg2 = /od/g;
    var b = str2.match(reg2);
    console.log(b) // ["od", "od"]

    // 结合ig  ig 和gi 没区别的
    var str3="Is this all there is?";
	var patt1=/is/ig;
	console.log(str3.match(patt1)) // ["Is", "is", "is"]
</script>
</body>
</html>
